#include <stdio.h>

int main()
{
	int num1 = 0 , num2 = 0;
	printf("请输入两个整数："); 
	scanf("%d%d",&num1,&num2);

	int max = 0 , min = 0;
	for(int i=1; i<num1; i++)
	{
		if(0 == num1%i && 0 == num2%i)
		{
			max = i;
		}
	}
	for(int i=num1*num2; i>=num1; i--)
	{
		if(0 == i%num1 && 0 == i%num2)
		{
			min = i;
		}
	}

	printf("%d %d\n",max,min);
}
